import { useTable, LIST_TYPE } from '@crud/index';
import { getAccountList as getList } from '@/api/crm-kgj/auth';

export const statusOptions = [
  {
    label: '不限',
    value: 0
  },
  {
    label: '在职',
    value: 1
  },
  {
    label: '离职',
    value: 2
  }
];
export const useTableList = (options: any = {}) => {
  const columns = [
    {
      label: '账号名称',
      prop: 'name',
      width: 280
    },
    {
      label: '手机号',
      prop: 'mobile',
      width: 150
    },
    {
      label: '岗位名称',
      prop: 'role_name',
      minWidth: 130
    },
    {
      label: '状态',
      prop: 'is_frozen',
      align: 'center',
      render: 'is_frozen',
      minWidth: 100
    },
    {
      label: '创建时间',
      prop: 'add_time',
      type: 'dateTime',
      minWidth: 177
    },
    {
      label: '操作',
      align: 'center',
      render: 'actions',
      minWidth: 100,
      fixed: 'right'
    }
  ];

  return useTable({
    ...options,
    type: LIST_TYPE.KGJ,
    params: {
      role_name: undefined,
      is_frozen: 0
    },
    columns,
    getList
  });
};
